package mc;

import java.util.Hashtable;

public class Manager {
    private final Hashtable<String, Block> showcase = new Hashtable<>();

    //建立名称和对象实例间的关系
    public void register(String name, Block proto) {
        showcase.put(name, proto);
    }

    public Block create(String protoname) {
        //取出对象实例
        Block block = showcase.get(protoname);
        return block.createClone();
    }
}
